package l1j.server.server.templates;

import java.sql.Timestamp;

import l1j.server.server.datatables.ItemTable;
import l1j.server.server.model.game.L1BugBearRace;

public class L1ShopItem {
	private final int _itemId;

	private L1Item _item;

	private final int _price;

	private final int _packCount;
	private final int _deleteDay; // 道具天數刪除系統(指定天數)
	private final int _remainingTime;// opqlo 使用時間限制

	private final Timestamp _deleteDate; // 道具天數刪除系統(指定日期)

	public L1ShopItem(final int itemId, final int price, final int packCount,
			final int deleteDay, final Timestamp deleteDate,
			final int RemainingTime) { // 道具天數刪除系統
		// public L1ShopItem(int itemId, int price, int packCount) {
		this._itemId = itemId;
		this._item = ItemTable.getInstance().getTemplate(itemId);
		this._price = price;
		this._packCount = packCount;
		this._deleteDay = deleteDay; // 道具天數刪除系統(指定天數)
		this._deleteDate = deleteDate; // 道具天數刪除系統(指定日期)
		this._remainingTime = RemainingTime;
	}

	// 道具天數刪除系統(指定日期)
	public Timestamp getDeleteDate() {
		return this._deleteDate;
	}

	// 道具天數刪除系統(指定天數)
	public int getDeleteDay() {
		return this._deleteDay;
	}

	public L1Item getItem() {
		return this._item;
	}

	public int getItemId() {
		return this._itemId;
	}

	public int getPackCount() {
		return this._packCount;
	}

	public int getPrice() {
		return this._price;
	}

	public int getRemainingTime() {
		return this._remainingTime;
	}

	// 食人妖精賽跑用
	public void setName(final int num) {
		final int trueNum = L1BugBearRace.getInstance().getRunner(num)
				.getNpcId() - 91350 + 1;
		this._item = (L1Item) this._item.clone();
		final String round = L1BugBearRace.getInstance().getRound() + "-"
				+ trueNum;
		this._item.setName(round);
		this._item.setUnidentifiedNameId(round);
		this._item.setIdentifiedNameId(round);
		this._item.setTicketName(L1BugBearRace.getInstance().getRunner(num)
				.getNameId());
	}

}
